package com.shopping.www.mapper;

import com.shopping.www.model.RegisterBean;
import com.shopping.www.model.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {

    @Select("select * from db_user where username=#{username} and password=#{password} and status=#{status}")
    User select(@Param("username") String username, @Param("password") String password, @Param("status") String status);

    @Select("select * from db_user where username=#{username}")
    RegisterBean selectByUsername(String username);

    @Insert("insert into db_user values(null,#{username},#{password},#{status},#{banStatus})")
    void add(User user);
}
